<?php  include VIEWPATH.'common/head.php';  ?>
    <script type="text/javascript">
        var status = '<?php echo $_GET['status'];?>';
        if(status == '-1'){
            alert('fail:<?php echo $_GET['msg'];?>');
        }
        //隐藏
        function setDel(tag_id){
            var url = "index.php?c=tag&m=set_status";
            var param = {"id":tag_id, "status":-1};
            common_ajax(url, param, function(data){
                if(data.errorCode == 0) {
                    //表单提交
                    window.location.href=  window.location.href;
                    return true;
                }else{
                    alert(data.errorMsg);
                }
            });
        }
    </script>
    <style>
        .checkbox_id{float: left;margin-top: 15px;
            margin-right: 5px;}
    </style>
    <body class="gray-bg">
    <div class="wrapper wrapper-content ">

        <div class="add-btn" style="float:right;">
            <div class="modal fade" id="tag_edit" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                <div class="modal-dialog" role="document" style="width: 70%;"><div class="modal-content"></div></div>
            </div>
        </div>
        <div class="clearfix"></div>

        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <a href="index.php?c=tag&m=tag_edit&type=2" class="btn btn-danger" data-toggle="modal" data-target="#tag_edit">添加</a>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <form class="form-horizontal" name="search" id="f_form" action="index.php?c=<?php echo $_REQUEST["c"];?>&m=<?php echo $_REQUEST["m"];?>" method="post">
                            <?php foreach($tagList as $k => $c){ ?>
                                <div class="tag-media-top <?php if($c['status'] == -1){echo "display_none";}?>">
                                    <button type="button" class="close" onclick="setDel(<?php echo $c['id'];?>)">×</button>
                                    <div class="checkbox_id">
                                        <input type="checkbox" name="tag_id[]" value="<?php echo $c['id'];?>" class="checkbox ck" />
                                    </div>
                                    <a href="index.php?c=tag&m=tag_info&tag_id=<?php echo $c['tag_id'];?>" class="tag-media-left" >
                                        <?php $imgPath = empty($c['img']) ? 'data/static/tag_default.jpg' : $c['img'];?>
                                        <img class="media-object" alt="64x64" src="<?php echo $imgPath;?>" style="width:48px;height:48px;">
                                    </a>
                                    <div class="tag-media-body" style="width: 70%;">
                                        <h4 class="media-heading">
                                            <a>
                                                <?php echo $c['title'];?>
                                            </a>
                                        </h4>
                                        <span><?php echo str_cut($c['description'],0,40) ? str_cut($c['description'],0,40) : '';?></span>
                                    </div>
                                    <div class="tag-media-right">
                                        <span class="i_z z"><strong><?php echo $c['user_num'];?></strong><em class="xg1">用户数</em></span>
                                        <span class="i_z z"><strong><?php echo $c['post_num'];?></strong><em class="xg1">帖子数</em></span>
                                        <div class="clearfix"></div>
                                    </div>
                                    <div class="tag-media-btn">
                                        <a href="index.php?c=tag&m=tag_edit&type=2&tag_id=<?php echo $c['id'];?>&page=<?php echo $page;?>" class="btn btn-warning warning_22" data-toggle="modal" data-target="#tag_edit">编辑</a>
                                    </div>
                                    <div class="clearfix"></div>
                                </div>
                            <?php } ?>

                            <div class="set_page">
                                <?php echo $multipage; ?>
                                <div class="set_del">
                                    <label class="l_c_sel" style="margin-left:0px;">
                                        <input type="checkbox" name="chkall" onclick="checkAll('prefix', this.form, 'tag_id')" class="c_sel" style="width:auto;">全选</label>
                                </div>
                                <div class="clearfix"></div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>

        </div>
    </div>

    <script src="http://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"></script>
<?php  include VIEWPATH.'common/footer.php';  ?>